package com.blogspot.oguzhan.game;

import java.util.ArrayList;
import java.util.List;

public class Puzzle extends Game{

	private PuzzleEngine engine;
	private List<Turn> turnHistory;
	private int indexOfIndex;
	
	public Puzzle(PuzzleEngine engine) {
		super(1);
		this.indexOfIndex = 0;
		this.engine = engine;
		this.turnHistory = new ArrayList<Turn>();
	}

	public void makeMove(Move move) {
		validateMove(move);
		engine.move(move);
		updateTurnHistory(move);
	}

	private void updateTurnHistory(Move move) {
		turnHistory.add(new Turn(indexOfIndex, move));
		this.indexOfIndex++;
	}

	private void validateMove(Move move) {
		super.checkPlayer(move.getOwner());
		
	}
}
